Define DryRunnable#dry_run?

A dry-runnable Agent can use this method to decide if it should avoid
affecting unsandboxed resources, like calling an external API that
might change any state.

Akinori MUSHA 10 years ago
parent
commit
40d6192070
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/concerns/dry_runnable.rb

+ 4 - 0
app/concerns/dry_runnable.rb

@@ -25,6 +25,10 @@ module DryRunnable
25 25
     )
26 26
   end
27 27
 
28
+  def dry_run?
29
+    is_a? Sandbox
30
+  end
31
+
28 32
   module Sandbox
29 33
     attr_accessor :results
30 34